package org.jivesoftware.smackx.provider;

import java.io.IOException;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smackx.entitycaps.packet.CapsExtension;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class CapsExtensionProvider
  implements PacketExtensionProvider
{
  private static final int MAX_DEPTH = 10;

  public PacketExtension parseExtension(XmlPullParser paramXmlPullParser)
    throws XmlPullParserException, IOException, XMPPException
  {
    String str1 = null;
    String str2 = null;
    String str3 = null;
    for (int i = 0; ; i++)
    {
      if ((paramXmlPullParser.getEventType() == 2) && (paramXmlPullParser.getName().equalsIgnoreCase("c")))
      {
        str1 = paramXmlPullParser.getAttributeValue(null, "hash");
        str2 = paramXmlPullParser.getAttributeValue(null, "ver");
        str3 = paramXmlPullParser.getAttributeValue(null, "node");
      }
      if ((paramXmlPullParser.getEventType() == 3) && (paramXmlPullParser.getName().equalsIgnoreCase("c")))
        break label122;
      paramXmlPullParser.next();
      if (i >= 10)
        break;
    }
    throw new XMPPException("Malformed caps element");
    label122: if ((str1 != null) && (str2 != null) && (str3 != null))
      return new CapsExtension(str3, str2, str1);
    throw new XMPPException("Caps elment with missing attributes");
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smackx.provider.CapsExtensionProvider
 * JD-Core Version:    0.6.1
 */